package cn.cvs.acl.controller;


import cn.cvs.acl.service.UserService;
import cn.cvs.baseservice.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(description = "用户管理")
@RestController
@RequestMapping("/acl/user")
@CrossOrigin
public class UserController {
    @Autowired
    private UserService userService;

    @ApiOperation(value = "获取管理用户分页列表")
    @GetMapping
    public R index() {
        return R.ok().data("items", userService.list(null));
    }

    @ApiOperation(value = "根据id列表删除管理用户")
    @DeleteMapping("/batchRemove")
    public R batchRemove(@RequestBody List<String> idList) {
        userService.removeByIds(idList);
        return R.ok();
    }
}

